#include "abcAll.h"
#include "customException.h"


template <class T>
T abc(const T& a, const T& b, const T& c)
{

    if(a <= 0 || b <= 0 || c <= 0)
        throw illegalParameterValue("All parameters should be... > 0");
    return a + b * c;
}

template <class T>
T abc(T a, T b, T c)
{
    return a + b * c;
}
template <class T>
T abc(T& a, T& b, T& c)
{
    return a + b * c;
}

template <class Ta, class Tb, class Tc>
Ta abc(const Ta& a, const Tb& b, const Tc& c)
{
    return a + b * c;
}
int abc(int a, int b, int c)
{
    if(a <= 0 || b <= 0 || c <= 0)
        throw illegalParameterValue("All parameters should be > 0");

    return a + b * c;
}


float abc(float a, float b, float c)
{
   return a + b * c;
}


#if 1
template <class T>
T rSum(T* a, int n)

/*
template <typename T>
T rSum(T a[], int n) */

{
    if (n > 0)
        //return rSum(a, n-1) + a[n-1];
        return 1;
    return 0;
}
#else
int rSum(int a[], int n)
{
    if (n > 0)
        return rSum(a, n - 1) + a[n - 1];
    return 0;
}
#endif